<?php
$this->load->helper('url');
?>
<!DOCTYPE HTML>
<html>
    <head>  
        <title>Projects</title>

        <link href="<?php echo base_url(); ?>assets/libs/datatables/css/demo_table.css" rel="stylesheet">
        <link href="<?php echo base_url(); ?>assets/libs/jqueryui/css/smoothness/jquery-ui-1.8.11.custom.css" rel="Stylesheet" />	
        <script src="<?php echo base_url(); ?>assets/libs/jquery/jquery-1.5.2.js"></script>
        <script src="<?php echo base_url(); ?>assets/libs/js/jquery.dataTables.js"></script>
        <script src="<?php echo base_url(); ?>assets/libs/jqueryui/js/jquery-ui-1.8.11.custom.min.js"></script>
        <script>$(document).ready(function() {
            oTable = $('#lol').dataTable({
                "bJQueryUI": true
            });
        } );
        </script>
    </head>
    <body>
        <div class="width">
            <?php
            if (!defined('BASEPATH'))
                exit('No direct script access allowed');

            print '<table cellpadding="0" cellspacing="0" border="0" class="display" summary="Output the Project Table" id="lol">';
            print '<thead>';
            print '<tr>';
            print '<th> ID </th>';
            print '<th> Name </th>';
            print '<th> Type </th>';
            print '<th> Description </th>';
            print '<th> Website </th>';
            print '<th> Email </th>';
            print '<th> Delete </th>';
            print '<th> Edit </th>';
            print '</tr>';
            print '</thead>';
            print '<tbody>';
            foreach ($query as $row) {
                print '<tr>';
                print '<td>' . $row->project_id . '</td>';
                print '<td>' . $row->project_name . '</td>';
                print '<td>' . $row->project_type . '</td>';
                print '<td>' . $row->project_description . '</td>';
                print '<td><a target="_blank" href="http://' . $row->project_website . '">' . $row->project_website . '</a></td>';
                print '<td>' . $row->project_email . '</td>';
                print '<td class="delete">' . anchor('projectcontroller/deleteProject/' . $row->project_id, 'Delete') . '</td>';
                print '<td class="edit">' . anchor('projectcontroller/editProject/' . $row->project_id, 'Edit') . '</td>';
                print '</tr>';
            }
            print '</tbody>';
            print '</table>';
            ?>
        </div>

    </body>
</html>
